package com.baidu.kshpt.aop;

import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.Signature;
import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

/**
 * @Autoor 杨博金ss
 */
@Aspect
@Component
public class WebAspect {

    @Pointcut("execution(* com.baidu.kshpt.controller.*.*(..))")
    public void pointCut(){

    }

    /**
     * 前置通知
     */
    @Before("pointCut()")
    public void beforeAdvice(JoinPoint joinPoint){
        System.out.println("前置通知");
        Signature signature = joinPoint.getSignature();
        String name = signature.getName();
    }

    @After("pointCut()")
    public void afterAdvice(JoinPoint joinPoint){
        System.out.println("最终通知");
        System.out.println("");
    }
}

